From: Marco Trevisan (TreviƱo) Date: Wed, 6 Dec 2017 05:55:37 +0000 (-0500) Subject: appDisplay: don't try to close the popup menu that is already destroyed X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~994^2^2~111 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=35eac697c10f6f3271f2d30d61df0e438ff0aaa6;p=gnome-shell.git appDisplay: don't try to close the popup menu that is already destroyed This would lead to a JS error otherwise, as we might end up in deleting actors that have been already destructed. https://bugzilla.gnome.org/show_bug.cgi?id=791233 --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 9b92311ac..c309471a0 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -1872,11 +1872,14 @@ var AppIconMenu = new Lang.Class({ this.actor.add_style_class_name('app-well-menu'); // Chain our visibility and lifecycle to that of the source - source.actor.connect('notify::mapped', Lang.bind(this, function () { + this._sourceMappedId = source.actor.connect('notify::mapped', () => { if (!source.actor.mapped) this.close(); - })); - source.actor.connect('destroy', Lang.bind(this, this.destroy)); + }); + source.actor.connect('destroy', () => { + source.actor.disconnect(this._sourceMappedId); + this.destroy(); + }); Main.uiGroup.add_actor(this.actor); },